﻿#pragma once

_NAMESPACE_BEGIN

/// 数学工具类
class MathTools
{
public:

	/// 单体类声明
	SINGLETON_HELPER(MathTools)
	
	MathTools();
	
	virtual ~MathTools();

	/// 四元数转3*3矩阵
	void Quat2Matrix(CONST_REF(Quaternion)quat, Matrix3& mat);	

	/// 3*3矩阵转四元数
	void Matrix2Quat(CONST_REF(Matrix3) mat, Quaternion&quat);	
	
	/// Ogre的Vector3转成PhysX的NxVec3
	void V2NxV(CONST_REF(Vector3)v,NxVec3& nxv)
	{
		nxv.x = v.x;
		nxv.y = v.y;
		nxv.z = v.z;
	}

	/// PhysX的NxVec3转成Ogre的Vector3
	void NxV2V(CONST_REF(NxVec3)nxv, Vector3& v)
	{
		v.x = nxv.x;
		v.y = nxv.y;
		v.z = nxv.z;
	}
};

_NAMESPACE_END